package edu.sctu.zhuyingzhi.month201506.day20150615.genericTypeTest.test2;

import java.util.Iterator;

/**
 * Created by user13 on 2015/6/15.
 */
public class Main {
    public static void main(String[] args) {
        Box<String> stringBox = new Box<String>("hahaha");
        System.out.println(stringBox.getData()+" "+stringBox.getClass());

        Box<Integer> integerBox = new Box<Integer>(11111);
        System.out.println(integerBox.getData()+" "+integerBox.getClass());

        Box<Number> numberBox = new Box<>(1212);
        System.out.println(numberBox.getData());

        getUpperNumberData(integerBox);
        getUpperNumberData(numberBox);
    }

    private static void getUpperNumberData(Box<? extends Number> data){
        System.out.println(data.getData());
    }
}
